﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TreaShares.Backoffice.Administrator
{
    public partial class ReportsManager : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnReportInsert_Click(object sender, EventArgs e)
        {
            TreaShares.Backoffice.Controlers.ReportsManager rm = new TreaShares.Backoffice.Controlers.ReportsManager();
            rm.Insert(this.txtDisplayName.Text, this.txtReportName.Text, this.txtDescription.Text, this.cbIsPublic.Checked);
            this.GridView1.DataBind();
        }

        protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (e.Row.RowState == DataControlRowState.Alternate)
                {
                    e.Row.Attributes.Add("onmouseover", "this.className='SelectedRowStyle'");
                    e.Row.Attributes.Add("onmouseout", "this.className='AlternatingRow'");
                }
                else
                {
                    e.Row.Attributes.Add("onmouseover", "this.className='SelectedRowStyle'");
                    e.Row.Attributes.Add("onmouseout", "this.className='RowBackColor'");
                }
            }
        }
    }
}